package com.huirui.server.controller.admin;

import com.huirui.server.pojo.result.Result;
import com.huirui.server.pojo.vo.OperationalDataVo;
import com.huirui.server.service.OperationalDataService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/operational/data")
@Slf4j
@Validated
@Tag(name = "运营数据查询", description = "微信小程序运营数据管理")
public class OperationalDataController {

    @Resource
    private OperationalDataService operationalDataService;

    @GetMapping
    @Operation(summary = "获取15天内的运营数据")
    public Result<OperationalDataVo> getOperationalData() {
        OperationalDataVo operationalDataVo = operationalDataService.getOperationalData();
        return Result.success(operationalDataVo);
    }

}
